//
//  CKSystemMessageCell.m
//  FreshBee
//
//  Created by chenkai on 16/10/19.
//  Copyright © 2016年 iOS013. All rights reserved.
//

#import "CKSystemMessageCell.h"

@interface CKSystemMessageCell ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *textViewHeightCons;


@end

@implementation CKSystemMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)showAllBtnClick:(UIButton *)sender {
    
    if(!sender.isSelected){
        [self openCell];
    }else{
        [self closeCell];
    }
    
    if(self.showAllClickBlick){
        self.showAllClickBlick(self);
    }
}

- (void)openCell{
    NSLog(@"openCell");

    self.textViewHeightCons.constant = 200;
    [UIView animateWithDuration:0.25 animations:^{
        self.layoutIfNeeded;
    }];
    self.showAllBtn.selected = YES;
}

- (void)closeCell{
    NSLog(@"closeCell");

    self.textViewHeightCons.constant = 30;
    [UIView animateWithDuration:0.25 animations:^{
        self.layoutIfNeeded;
    }];
    self.showAllBtn.selected = NO;
}




@end






